<template>
    <div class="student-home">
        <el-container>
            <el-aside width="180px">
                <h3>USTH教务管理系统</h3>
                <el-row>
                    <el-menu default-active="/student/profile" class="el-menu-vertical-demo"
                        background-color="rgba(4, 24, 50)" text-color="#fff" router active-text-color="#ffd04b">
                        <el-submenu index="/student">
                            <template slot="title">
                                <i class="el-icon-location"></i>
                                <span>个人管理</span>
                            </template>
                            <el-menu-item-group>
                                <el-menu-item index="/student/studentInfo">学生学籍信息</el-menu-item>
                                <el-menu-item index="/student/modifyInfo">个人信息修改</el-menu-item>
                            </el-menu-item-group>
                        </el-submenu>
                        <el-submenu index="/student/resources">
                            <template slot="title">
                                <i class="el-icon-location"></i>
                                <span>教学资源</span>
                            </template>
                            <el-menu-item-group>
                                <el-menu-item index="/student/schedule">班级课表</el-menu-item>
                                <el-menu-item index="/student/studentcourse">教师课表</el-menu-item>
                            </el-menu-item-group>
                        </el-submenu>
                        <el-submenu index="/student/exam-management">
                            <template slot="title">
                                <i class="el-icon-location"></i>
                                <span>考务管理</span>
                            </template>
                            <el-menu-item-group>
                                <el-menu-item index="/student/yitest">已考学科</el-menu-item>
                                <el-menu-item index="/student/untest">未考学科</el-menu-item>
                            </el-menu-item-group>
                        </el-submenu>
                        <el-menu-item index="/login" @click="logout">
                            <i class="el-icon-thumb"></i>
                            <span slot="title">退出登录</span>
                        </el-menu-item>
                    </el-menu>
                </el-row>
            </el-aside>
            <el-container>
                <el-header>
               
                </el-header>
                <el-main>
                    <router-view></router-view>
                </el-main>
            </el-container>
        </el-container>
    </div>
</template>

<script>
export default {
    name: 'StudentHome',
    methods: {
        logout() {
            this.$router.push('/login');
        }
    }
};  
</script>

<style scoped>
.el-aside {
    height: 100vh;
    background-color: rgba(4, 24, 50);
}

.el-header {
    background-color: rgb(230, 232, 242);
}

.el-aside>h3 {
    color: #29325a;
    height: 60px;
    text-align: center;
    line-height: 60px;
    background-color: rgb(230, 232, 242);
}

.student-home {
    text-align: center;
}

/* 添加鼠标悬停样式 */
.el-menu-item span,
.el-submenu__title span {
    transition: color 0.3s, font-size 0.3s;
    /* 添加过渡效果 */
}

.el-menu-item:hover span,
.el-submenu__title:hover span {
    color: rgb(255, 204, 0);
    /* 文字颜色变为黄色 */
    font-size: 16px;
    /* 字体变大，这里可以根据需要调整大小 */
}

/* 确保子菜单项也应用相同的悬停样式 */
.el-submenu .el-menu-item span {
    transition: color 0.3s, font-size 0.3s;
    /* 添加过渡效果 */
}

.el-submenu .el-menu-item:hover span {
    color: rgb(255, 204, 0);
    /* 文字颜色变为黄色 */
    font-size: 16px;
    /* 字体变大，这里可以根据需要调整大小 */
}
</style>